Support querying custom event properties#34
Open
chrmod wants to merge 1 commit into
Open
Conversation
Break down by any event:props:<name> dimension and filter any query tool by custom property values, so sites can slice by the properties their own tracker sends.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds support for Plausible custom event properties (
event:props:<name>) across the query tools, generically — property names aren't hardcoded, so any site can query whatever its own tracker sends.get_breakdownaccepts adimensionofevent:props:<name>(e.g.event:props:plan) alongside the standard dimensions.get_breakdown,get_timeseries,get_conversions,compare_periods) via a newproperty_filtersinput, e.g.[{ "property": "plan", "operator": "is", "values": ["pro"] }]. Operators:is,is_not,contains,contains_not; entries combine with AND.Why
Sites commonly attach custom properties to events (plan tier, outbound link target, etc.). The tools could previously only reach the built-in dimensions, so those segments were unreachable through the MCP.
Approach
Shared
dimensionSchema,propertyFiltersSchema, andbuildPropertyFilterslive insrc/schemas.ts; each tool wiresproperty_filtersin the same way it already handlespage/goal. The serverinstructionsnow document theevent:props:convention to steer clients away from malformed queries. Kept focused: no new tools, no changes to existing query shapes.Test plan
In an MCP client pointed at a server for a site that sends custom properties:
plan") and confirm rows are grouped by that property's values.planispro") and confirm the numbers are scoped to that value.